Monitor Linux System Performance with top and htop

Introduction

When managing Linux servers, especially on Red Hat-based systems as RHEL, Rocky Linux or any distribution of Linux, real-time monitoring tools like top and htop are handy. They provide a glance of your system health as CPU usage, memory consumption, process details and more.

 In this post, we'll walk you through the requirements, installation and usage of both top and htop on Linux systems.

Monitoring system performance in the Linux requires a basic understanding of the operating system. If you are new to the Linux start with our beginner guide on What is Linux? An Introduction to Linux and Its Popular Distributions.

Requirements

                A Linux-based system (RHEL, Ubuntu, and Rocky Linux or any Linux distribution)

                Access to terminal (CLI)

                Sudo privileges


Installation:

Mostly top utility is pre-installed on all Linux distributions; however, htop is not installed by default in RHEL 9. You can run it directly by typing top on bash.

Process management in the Linux is performed through the command line using tools such as ps, top and kill. you are new to the Linux terminal start with our tutorial on 10 Linux Basic Commands Every Beginner Should Know.

#top

If htop is not pre-installed on any Linux distribution, you can easily install it. As is the case, htop is not installed on RHEL 9. Now, follow the following steps to install htop in RHEL 9.

Step 1: Enable the EPEL repository if not already enabled

EPEL stands for Extra Packages for Enterprise Linux. It is a community-driven repository maintained by the Fedora project that provides additional software packages that are not included in the official Red Hat or CentOS repositories. The EPEL repository includes these extra open-source packages built to be fully compatible with RHEL-based systems.

Here epel repository is enabled by this command on RHEL 9.

Now install epel-release with the command sudo dnf install epel-release. you must enable the EPEL repository before installing htop; otherwise, you will get an error message.

#sudo dnf install epel-release

System monitoring tools display the detailed information about the running processes and resource usage. To understand how to manage the processes in the Linux read our guide on Linux Process Management for Beginners – Complete Guide 2025.

Step 2: Install htop

# sudo dnf install htop


That’s it. Check htop is successfully installed with the command htop --version. Now htop is ready to use.


Usage

To start monitoring issue top command on bash.

# top


This is the interface of the top command with real-time statistics of the Linux system.

The High CPU or memory usage can sometimes be caused by the network services running on a Linux server. understanding the networking concepts and the troubleshooting read our guide on Linux Basic Networking for Beginners – Complete Guide 2025.

You’ll see real-time statistics. Here's what each section means:

·       Load average: System load over 1, 5 and 15 minutes

·       Up Time: shows the up time of the system

·       Total Task: show the total task

·       Seeping Task: show any sleeping process

·       Zombie Task: show any zombie process

·       Stopped Task: show any of the stopped processes

·       Running Task: number of running tasks

·       Tasks: Number of running, sleeping and stopped processes

·       %CPU: CPU usage per process

·       %MEM: Memory usage per process

·       Swap Memory: usage of swap memory


Common commands within top:

You can run commands during the top running interface to control things in real time like the following commands.


q: Quit

k: Kill a process (you'll be prompted for PID)

r: Renice a process (change priority)

h: Help


Using htop

To start monitoring with htop, issue the htop command on bash.

# htop

You'll get a colorful, interactive dashboard.

Features:

  •   Scroll with arrow keys
  •   Use F3 for search and F4 for filter
  •   F9 kills process and F6 changes sort column

Comparison between top and htop


top

  •     By default installed in almost all distributions
  •     Provides basic system information and lists processes sorted by CPU or memory usage
  •     Offers fewer command-line options for filtering and sorting
  •     Comparatively simple to use for basic monitoring


htop

  •       Installation is required before using
  •     Includes colored output, supports mouse input and easy process management
  •      An interactive interface with a visually more appealing
  •      Offers robust, customized options sorting and display
  •      Requires more deeper learning curve due to its advanced features

Key Differences


Feature

top

htop

Default installation

Yes

No

User interface

Basic text-based

Enhanced, interactive, color-coded

Mouse support

No

Yes

Process management

Limited

More intuitive, including killing/renicing

Customization

Basic

Extensive

Learning curve

Low

Moderate


Best Practices for Using top and htop 

  • Use top for minimal resource monitoring on production systems
  •  Prefer htop for interactive and colorful visualization
  • Combine htop with tools like vmstat or iostat for deeper analysis
  • Avoid running htop continuously on low-memory systems
  • Use htop -d 5 to reduce refresh frequency and save CPU usage


Frequently Asked Questions (FAQs)

Q1: What is the top command used for in Linux?  

It displays a real-time summary of running processes, CPU, and memory usage.


Q2: What is the difference between top and htop?

htop offers an interactive, color-coded interface and easier process management compared to the traditional top.


Q3: How can I kill a process using htop?

Select the process with the arrow keys and press F9 to kill it.


Q4: Is htop available on all Linux distributions?

Not by default; you may need to install it using your package manager.


Q5: Can top or htop affect system performance?

They use minimal resources and are safe to run even on production systems.


Monitoring system performance is also useful for identifying the unusual activity or unauthorized processes. protect your system further read our guide on How to Secure SSH Access on Linux.

Final Thoughts

Both top and htop is essential tools in a Linux admin's toolbox. While top is always available and reliable, htop brings user-friendly enhancements that make system monitoring much more interactive. You are diagnosing system performance issues or monitoring your system load, mastering these tools will give you a deep understanding of what is happening under the hood.

keep visiting seeklinux for more updates and information.


SeekLinux Author
SeekLinux Team
Linux Engineers | DevOps | Security Enthusiasts

SeekLinux Team shares practical Linux tutorials, SSL/TLS certificate guides, commands and DevOps solutions. Our goal is to simplify system administration and help you master real-world server and security tasks.

Learn more about us →

Post a Comment